package xkp.lesson3;

import xkp.lesson2.Car;

public class Demo1 {
	public static void main(String[] args) {
		/*
		 * MyClass class1 = new MyClass(); class1.
		 */
		Person person1 = new Person(20, "张三");
		Person person2 = new Person(20, "张三");
		// == 比较的是字面量
		System.out.println(person1 == person2);
		//System.out.println(person1.isDeng(person2));

		Car car = new Car();
		//把人和车比完全没有意义
		//人应该与人去比较
		//person1.equals(car);
		Person person = new Person();
		Student student = new Student();
		System.out.println(person instanceof Student);
		System.out.println(student instanceof Object);
		System.out.println(person1.equals(person2));
		System.out.println("---------------------------------");
		Student student1 = new Student(101, 20, "张三"); 
		Student student2 = new Student(101, 20, "张三"); 
		System.out.println(student1 == student2); //false
		System.out.println(student1.equals(student2));
		
	}

}
